this.addEventListener('install', function (event) {
  event.waitUntil(
    caches.open('test-cache')
      .then(function (cache) {
        return cache.addAll(['./', './index.html'])
      })
  )
})

this.addEventListener('fetch', function (event) {
  if (/\.gif$/.test(event.request.url)) {
    event.respondWith(fetch('./45.png'));
  }
})